﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NutriLeaf.Web.Core.Forum
{
    //doubt
    public class FourmCategory:IForumCategory
    {
        public void AddForumCategory(string categoryName, string categoryDescription, ref Model.NutriLeafDBEntities context)
        {
            Model.ForumCategory cat = new Model.ForumCategory();
            cat.CategoryName = categoryName;
            cat.CategoryDescription = categoryDescription;
            context.ForumCategories.AddObject(cat);
            context.SaveChanges();
            
        }

        public void AddForumSubCateogy(string categoryName, string categoryDescription, Model.ForumCategory parentCategory, ref Model.NutriLeafDBEntities context)
        {
            //doubt
            Model.ForumCategory cat = context.ForumCategories.Where(p => p.ForumCategoryID == parentCategory.ForumCategoryID).First();
            
          
        }

        public void AddForumSubCateogy(string categoryName, string categoryDescription, int parentCategoryId, ref Model.NutriLeafDBEntities context)
        {
          
            Model.ForumCategory cateogry = new Model.ForumCategory();

            cateogry.CategoryDescription = categoryDescription;
            cateogry.CategoryName = categoryName;
            cateogry.ParentCategoryID = parentCategoryId;
          
        }

        public List<Model.ForumCategory> GetSubCategories(int ForumCategoryId, ref Model.NutriLeafDBEntities context)
        {
            Model.ForumCategory cat;
      
            return context.ForumCategories.Where(p => p.ForumCategoryID == ForumCategoryId).ToList();
        }

        public Model.ForumCategory GetParentCategory(int ForumCategoryId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public Model.ForumCategory GetForumCategory(int ForumCategoryId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public void RemoveAllSubCategories(int ForumCategoryId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public void RemoveForumCategory(int ForumCategoyrId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public void AddForumToForumCategory(int ForumId, int ForumCategoryId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public void RemoveForumFromForumCategory(int ForumId, int ForumCategoryId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public List<Model.ForumCategory> GetForumCategoriesOfForum(int ForumId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }

        public List<Model.ForumThread> GetForumsInCategory(int categoryId, ref Model.NutriLeafDBEntities context)
        {
            throw new NotImplementedException();
        }
    }
}